<%@ page import="com.entity.RegisterDoc" %>
<%@ page import="java.util.Vector" %>
<%@ page import="com.service.PatientService" %>
<%@ page import="com.entity.Patient" %><%--
  Created by IntelliJ IDEA.
  User: 95241
  Date: 2021/9/22
  Time: 22:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>未处理挂号名单</title>

    <link rel="stylesheet" type="text/css" href="css/deal.css">
</head>
<body style="background-color: #EBECF0">
<br>
<br>

<h2 style="margin-left: 15%">未处理挂号名单</h2>
<br>

<hr align=center width="70%" SIZE=3>
<br>
<br>

<center>
    <form action="doctorServlet">
    <table border="1" cellspacing="0" width=70% cellpadding="20">
        <tr bgcolor="#a9a9a9">
            <th align="center">单号</th>
            <th align="center">姓名</th>
            <th align="center">性别</th>
            <th align="center">年龄</th>
            <th align="center">身份证号</th>
            <th align="center">诊断</th>
        </tr>


        <%
            Vector<RegisterDoc> registerDocs = (Vector<RegisterDoc>) request.getAttribute("noRegisters");
            RegisterDoc registerDoc;
            PatientService patientService = new PatientService();
            if(registerDocs!=null){
                int index =1;
                int size = registerDocs.size();
                while (size>0){
                    registerDoc = registerDocs.get(size-1);
//                    System.out.printf(registerDoc.getWorkId());
                    Patient patient = patientService.findThisPatient(registerDoc.getAccount());
                    if(registerDoc!=null){
        %>
        <tr>
            <input type = "hidden" name = "skip" value="deal">
            <input type = "hidden" name = "addId" value="<%=registerDoc.getId()%>">
            <td align="center"><%=registerDoc.getId()%></td>
            <td align="center"><%=registerDoc.getPatientName()%></td>
            <td align="center"><%=registerDoc.getSexString()%></td>
            <td align="center"><%=patient.getAge()%></td>
            <td align="center"><%=patient.getIdentityId()%></td>
            <td align="center"><input type="submit" value="诊断" class="sub"></td>
        </tr>
        <%
                        System.out.println(registerDoc.getId());
                    }
                    size -= 1;
                }
            }
            else
                        System.out.printf("000000");
        %>
    </table>
    </form>

    <br>
    <br>
    <a href="doctorServlet?skip=mainPage"><input type="button" value="返回" class="sub"></a>
</center>

</body>
</html>
